package com.cy3;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Random;

public class CallNameDemo {
    public static void main(String[] args)throws IOException {
        BufferedReader br = new BufferedReader(new FileReader("myCharStream\\Names"));
        ArrayList<String> arr = new ArrayList<>();
        String line;
        while((line=br.readLine())!=null){
            arr.add(line);
        }
        br.close();
        Random random = new Random();
        int i = random.nextInt(arr.size());
        System.out.println(arr.get(i));


    }
}
